Phosphorus-doped T-graphene nanocapsule toward O3 and SO2 gas sensing: a DFT and QTAIM analysis

Tetragonal graphene nano-capsule (TGC), a novel stable carbon allotrope of sp2 hybridization is designed and doped with phosphorus (P) to study the O3 and SO2 gas sensitivity via density functional theory calculation. Real frequencies verified the natural existence of both TGC and P-doped TGC (PTGC). Both TGC and PTGC suffer structural deformations due to interaction with O3 and SO2 gases. The amount of charge transfer from the adsorbent to the gas molecule is significantly greater for O3 adsorption than SO2 adsorption. The adsorption energies for TGC + O3 and PTGC + O3 complexes are − 3.46 and − 4.34 eV respectively, whereas for TGC + SO2 and PTGC + SO2 complexes the value decreased to − 0.29 and − 0.30 eV respectively. The dissociation of O3 is observed via interaction with PTGC. A significant variation in electronic energy gap and conductivity results from gas adsorption which can provide efficient electrical responses via gas adsorption. The blue/red shift in the optical response proved to be a way of detecting the types of adsorbed gases. The adsorption of O3 is exothermic and spontaneous whereas the adsorption of SO2 is endothermic and non-spontaneous. The negative change in entropy verifies the thermodynamic stability of all the complexes. QTAIM analysis reveals strong covalent or partial covalent interactions between absorbent and adsorbate. The significant variation in electrical and optical response with optimal adsorbent-gas interaction strength makes both TGC and PTGC promising candidates for O3 and SO2 sensing.

Environmental contamination caused by industrial wastes and other byproducts has increased as a result of rapid industrialization.Many dangerous gases, including those produced by motorized traffic, power plants, industry, biological waste, and other sources, are present in the environment 1 .These gases include CH 4 , CO, SO 2 , CO 2 , NO, NH 3 , CH 3 OH, H 2 S, O 3 , PH 3 , and COCl 2 [2][3][4] .The well-known air contaminant ozone (O 3 ) has negative effects on the mucosa in the eyes and respiratory tissues.The lung is the primary target of tropospheric ozone in humans, which has detrimental effects on bodily functions 5 .Another common type of air pollution is sulfur dioxide (SO 2 ), which is colorless, corrosive, and highly excitant.The interaction of SO 2 with the surrounding air can cause several concerns to human health as well as harmful effects on the environment 4 .Monitoring these dangerous gases is crucial for creating a healthier living environment, which is what spurred the advancement of innovative techniques for sensing these gases.A sensing material demonstrates an alteration in resistivity/ conductivity due to charge transfer between the adsorbent and gas molecules 6,7 .
The numerous bonding modes of carbon (C) atoms, which are widely dispersed in nature, allow them to form a broad variety of allotropes with distinct physical and chemical characteristics, including diamond carbon nanotubes, fullerene, graphene, and so on 8 .However, for toxic gas detection, pure graphene is too chemically inert and insensitive to be of much value 2 , which led the researchers to study the sensitivity of various allotropes of C in both pristine and doped states for gas sensing applications [8][9][10][11][12][13][14][15] .P-doped graphene showed strong chemisorption of SO 2 , NO 2 , O 2 , etc. 14 .According to the theoretical investigation of Yu et al., O 3 gas decomposes to O 2 gas via interaction with P-and N-doped graphene 10 .Pt-doped graphene showed strong adsorption of O 3 compared to SO 2 15 .Fullerene showed a high sensitivity toward H 2 S, CH 4 , C 3 H 8 , etc. toxic gases in theoretical and experimental investigations 13 .The presence of several gases, e.g., NO 2 , NH 3 , and so on can alter the conductivity of carbon nanotube (CNT) significantly 16 .The sensitivity of CNT for NH 3 , NO 2 , etc. toxic gases has enhanced when decorated with metal 11,12 .Compared to all other anticipated graphene variants, including the newly produced

Computational details
The nanocapsules of TGC and PTGC QDs are designed via "GaussView 06" and optimized to stable ground state energies by DFT calculation in "Gaussian 09W" software.For geometry optimization, we used the dispersioncorrected B3LYP-D3 functional with the 6-31G(d) basis set which can provide a good estimation of adsorption energies in the study 3 .The energy and frequency calculations were performed to understand the optical response and dynamic stability of the geometries.For a better estimation of the energy gap, the HSEH1PBE hybrid functional with LanL2DZ basis set was employed 21 .The stable configurations of the adsorbent + gas complex were chosen using the Adsorption Locator module 22,23 .The adsorption energy ( E ads ) of the adsorbent + gas complexes were calculated via Eq.( 1), where, E complex , E capsule , and E gas represent the energy of the complex structures, capsules, and gas molecules respectively 24,25 .The basis set superposition error (BSSE) in the electronic structure of molecules occurs when orbitals are approximated using the expansion of basis functions, and this has to be examined.The corresponding energy of BSSE ( E BSSE ) were calculated via counterpoise method 26,27 .The adsorption energies of the complexes can be corrected using the following equation 3,28 .
where E ads_BSSE represents the BSSE-corrected adsorption energy.
The cohesive energy (E C ) of the adsorbents was estimated by Eq. ( 3) 29 , where, E Adbnt , E x , and n x represent the adsorbent energy, energy of individual (x) species, and number of x species.The Mulliken charges (MC), electrostatic potential map (EPM), partial density of states (PDOS), highest occupied molecular orbital (HOMO), lowest unoccupied molecular orbital (LUMO), and energy gap of the geometries were studied to understand the electronic characteristics of the structures.The vital electronic parameters and global indices are calculated by the following set of equations [30][31][32] .
where E L , E H , E f , E g , ϒ, �, λ, and ξ represent the HOMO's energy, LUMO's energy, fermi energy, energy gap (HOMO-LUMO gap), global hardness, chemical potential, global softness, and electrophilicity index, respectively.The variation in thermodynamic parameters i.e., enthalpy (H), Gibbs free energy (G), and entropy (S) can be calculated from the following relations 21 . (1) where, complex , capsule , and gas represent H/G of the complex structures, the adsorbent, and the gas molecules.denotes enthalpy variation (∆H) or free energy variation (∆G).The nature of the gas-adsorbent interactions was understood via QTAIM analysis using the AIMALL package 33 .

Geometry analysis
The designed T-graphyne capsule (TGC) and P-doped T-graphyne capsule (PTGC) contain a total of 56 atoms (Fig. 1) possessing cohesive energies of − 8.42 and − 8.35 eV respectively suggesting a strong binding of the molecules.The average C-C bond length of the TGC QD is analogous to that of graphene, T-graphene, and CNT 34,35 .P-doping results in a significant structural deformation due to the higher atomic radius of P. Table 1 shows the variation in bond lengths between elements due to the adsorption of O 3 gases.The values in the parenthesis represent the bond lengths before adsorption.The adsorption of O 3 results in a significant deformation of TGC proven by the excessive changes in bond lengths.On the other hand, comparatively smaller variation in C-C bond lengths is observed due to PTGC + O 3 interaction.However, the C-P bond lengths change to a great extent after adsorption.It is observed that the O 3 molecule dissociates into O 2 and oxygenates PTGC.The SO 2 gas molecule shows lesser interaction with TGC and PTGC compared to O 3 .Very slight deformation is observed in the molecules via nominal variation in C-C, C-P, and S=O bond lengths.SO 2 does not reveal any dissociation of molecules like O 3 .The SO 2 gas molecule shows lesser interaction with TGC and PTGC compared to O 3 .Very slight deformation is observed in the molecules via nominal variation in C-C, C-P, and S=O bond lengths.SO 2 does not reveal any dissociation of molecules like O 3 .

Adsorption analysis
The adsorption energy ( E ads ) represents the amount of energy required to separate the adsorbate from the adsorbent surface.Both the adsorbents show exothermic adsorption of the selected gas molecules.O 3 shows very strong adsorption in both TGC and PTGC quantum dots.Although, SO 2 shows weaker interaction than O 3 , the adsorption energies are still suitable for sensing application.The adsorption energies for O 3 are significantly higher on the selected adsorbents than on B-doped graphene 36 , Pt-decorated graphene 15 , B 12 N 12 nanocage 37 , and MoS 2 38 .Whereas TGC and PTGC show comparatively stronger adsorption of SO 2 than B-doped graphene 36 , terthiophene 39 , B 12 N 12 nanocage 37 , and B 12 P 12 nanoclusters 40 adsorbents.
One of the vital characteristics of the adsorbent for sensing applications is the recovery time ( τ ).The recovery time can be calculated from Eq. ( 12) 2,3 .
where, f r is the frequency of the irradiated electromagnetic (EM) wave.In experiments, the UV radiation ( f r =10 12 -10 14 Hz) is used for regenerating adsorbents.The temperature (T) of 298 K is used in this study.
The TGC + SO 2 and PTGC + SO 2 complexes show a recovery time of 2.7 ns and 3.23 ns suggesting a fast recovery via UV irradiation at room temperature makes both adsorbents suitable candidates for SO 2 adsorption.On the other hand, due to high adsorption energies, both TGC + O 3 and PTGC + O 3 complexes possess a high recovery time (Table 2).The recovery time remains impractical upon X-ray irradiation at 600 K temperature suggesting that the adsorbents cannot be recoverable via the conventional irradiation technique.In this circumstance, the adsorbents may regenerate through chemical reactions.Some of the commonly used regenerating agents e.g., HCl, NaOH, HNO 3 , NaHCO 3 , etc. may show better performance in recovering both adsorbents which require further investigations 21,41 .

Vibrational properties
The frequency analysis reveals the vibrational modes in the molecular systems along with their dynamic stability.The TGC, PTGC and all their complexes possess real frequencies (Fig. 2) signifying all the geometries are stable and can exist in nature 42,43 .The IR peaks near 1528-1539 cm −1 indicate C-C stretching in the normal direction to the capsule length, whereas the peak near 1747 cm −1 represents C-C stretching along the capsule length.A P-C vibration of the PTGC molecule is observed near 1290 cm −1 .Through the adsorption of toxic gases, a slight variation in the peak position is observed due to the structural deformation.In the TGC + O 3 complex, O-O-O bending, O-O asymmetric stretching, O-O symmetric stretching and C-O stretching are observed at 633, 727, 916, and 1025 cm −1 , respectively.The peaks near 502 and 1129 cm −1 represent O=S=O bending and S=O stretching, respectively in the TGC + SO 2 complex.On the other hand, 499 and 1127 cm -1 peaks indicate the O=S=O bending and S=O stretching in the PTGC + SO 2 complex.Due to the dissociation of O 3 in the PTGC + O 3 complex, O=O stretching and P=O stretching is observed near 1653 and 1249 cm −1 , respectively.

Electronic properties
Electronic properties can provide significant information about the sensitivity of the adsorbents toward the selected gases 44,45 .Figure 3    Figure 4 shows the overall charge transfer toward gas molecules via adsorbate-adsorbent interaction.The maximum charge transfer on O 3 molecule occurs on TGC adsorbent whereas PTGC shows more charge transfer compared to TGC toward SO 2 .
Figure 5 demonstrates the electrostatic potential map (EPM) of the absorbents and complexes.is an indispensable tool for deciphering the electrostatic potential arising from the arrangement of electrons and nuclei within a molecule, thereby allowing for the identification of potential reaction sites for both electrophilic and nucleophilic attacks.The red region indicates the negative potential i.e., the electron-rich region whereas the blue region represents the electron deficit region or positive potential region.The TGC adsorbent is almost neutral resulting in a uniform distribution of negative and positive charges.On the other hand, due to the asymmetry of charge distribution in the PTGC, the P-site region becomes a comparatively stronger electrophilic attack zone.The interaction with O 3 and SO 2 , the O-site region demonstrates to be a more electron-rich region due to the high electronegativity of the O atom.The S-site region shows comparatively positive potential due to low electron density.The noticeable color change in both TGC and PTGC upon adsorption indicates a substantial charge transfer, implying a robust adsorbent-adsorbate interaction.
Figures 6 and 7 show the HOMOs and LUMOs TGC and PTGC along with their complexes respectively.Both HOMO and LUMO are localized in the TGC after gas adsorption.A nominal contribution to HOMO and LUMO is localized on the O 3 molecule adsorbed on TGC.On the other hand, a significant localization of LUMO was observed on the SO 2 molecule of the PTGC + SO 2 complex.Both adsorbents demonstrate a significant change in HOMOs and LUMOs due to toxic gas adsorption signifying strong interaction with notable charge transfer.The energies of HOMOs and LUMOs in the geometries are presented in Table 3.
The PDOS spectra are analyzed for a thorough understanding of electronic properties' variation (Fig. 8).The TGC showed an energy gap of 1.18 eV making it suitable for numerous semiconducting applications (Table 3).P-doping results in a low energy gap semiconductor through energy gap tuning.The energies of HOMOs and LUMOs of both adsorbents suffer a significant variation due to gas adsorption, resulting in an alteration of the energy gap.It is observed that the energies HOMOs of both TGC and PTGC significantly decrease after gas adsorption (Table 3), whereas the LUMO energies increase due to O 3 adsorption but decrease through SO 2 adsorption.The O and S atoms do not demonstrate any contribution to HOMOs and LUMOs of TGC and PTGC (except PTGC + SO 2 , where a significant orbital contribution of both O and S are observed at LUMO).The observed PDOS spectra justify the HOMO and LUMO representation in Figs. 6 and 7. Figure 9 shows the variation in the energy gap of TGC and PTGC due to the interaction with gas molecules.
The variation in the energy gap can be a result of the variation in charge distribution and structural deformation in the adsorption process 21,46 .The change in energy gap results in a variation of electronic conductivity (EC) which follows the Eq. ( 13).
where, K b and T represent the Boltzmann constant and absolute temperature 3 .The change in conductivity can provide a significant electrical response due to gas adsorption which makes TGC and PTGC potential materials  The work function (φ), which is the energy needed to remove an electron from the fermi level and bring it to the vacuum, is a surface-dependent characteristic of the adsorbents.The materials' conductivity is impacted by changes in work function 47 .The work function is related to the fermi energy by the following equation, ( 14) where, V ∞+ is the electrostatic potential of an electron far away from the adsorbent's surface.Table 3 shows that φ varies significantly via gas interaction suggesting a significant change in conductivity of the adsorbents.The

Global indices
Several reactivity parameters such as hardness, softness, chemical potential, and electrophilicity are calculated and their numerical values are given in Table 4.The corresponding values of Chemical hardness and electrophilicity, respectively, are small and large as compared to various carbon and boron nitride nanostructures while the chemical potential values are quite similar [49][50][51] .All the complexes of TGC and PTGC offer negative chemical potential value indicating their structural stability.The chemical hardness is a measure of opposition to charge transfer from a material whereas the softness signifies its opposite characteristic 52 .The hardness of TGC is increased slightly after absorption of O 3 and SO 2 indicating chemical stability upon gas adsorption.P doping reduces the value of hardness to about half that of its pristine structure.Although O 3 adsorption causes PTGC to almost regain the hardness of its pristine form, SO 2 adsorption dramatically declines the hardness and hence increases the chemical reactivity of PTGC which is also ensured by the very large value of electrophilicity.

Thermal properties
The thermodynamic stability of the complex structures can be understood from the change in enthalpy, Gibbs free energy, and entropy 26 .Their corresponding values after the adsorption of O 3 and SO 2 are tabulated in Table 5.
The change in enthalpy (ΔH) upon O 3 adsorption for both TGC and PTGC are found to be − 3.15 and − 4.07 eV/ atom respectively which signify that their interactions are exothermic and the bonding between the atoms of TGC + O 3 and PTGC + O 3 are more stable.Similarly, the change in Gibbs free energies (ΔG) is also negative for O 3 adsorption and positive for SO 2 adsorption which implies that O 3 adsorption is a spontaneous process whereas SO 2 adsorption is a non-spontaneous process 26,53 .The interaction of SO 2 with TGC and PTGC is endothermic with a ΔH value of 0.005 and 0.01 eV/atom respectively.Entropy is a measure of a molecule's freedom of motion.It is higher when the product molecules have greater freedom of motion and is less positive if the product molecules are more ordered.The change in entropy due to the adsorption of O 3 and SO 2 on both TGC and PTGC is negative indicating that the complexes are thermodynamically ordered and stable 21,54 .

Optical properties
The molar absorption coefficient (ε), as determined through UV-visible response analysis for all structures, is presented in Fig. 10.Both pristine configurations displayed a significant absorption coefficient (AC) with a strong absorption peak in the visible wavelength region.PTGC shows strong absorption in higher wavelength regions compared to TGC, verifying the smaller energy gap of PTGC than TGC.The strong absorption in the visible wavelength region makes both TGC and PTGC potential candidates for optoelectronic research.An increased optical responsiveness at a particular wavelength is correlated with a greater AC.In both adsorbents, gas adsorption is shown to cause a significant change in the AC spectra.Along with the variation in the intensity of AC, a significant red/blue shifting of the absorption peak is observed due to the interaction with gas molecules.The reflectivity of the is related to the AC by the following equations, where Abs, C, l, Tra, and Ref indicate the absorbance, concentration, material thickness, transmittance, and reflectance, respectively 21 .As a result, a red/blue shift in AC likewise produces a red/blue shift in the structure's reflectivity, changing its color; in other words, adsorbents may change color by gas adsorption.Consequently, color fluctuation may be used to identify and detect the type of toxic gas adsorbed on TGC or PTGC.

QTAIM analysis
To gain a profound understanding of the nature and strength of molecular interactions, an in-depth Quantum Theory of Atoms in Molecules (QTAIM) analysis was performed on all complex structures.Figure 11 illustrates the molecular graph of these structures, with the green spots indicating the bond critical (BC) point.This BC point is crucial for assessing and ensuring the strength of intermolecular bonds.Hence, to characterize different types of interactions, descriptors including electron density (ρ e ), ∇ 2 (ρ e ) , electron's kinetic energy density (ED) ( G e ), potential ED ( V e ), and total ED ( H e ) have been acquired at bond critical (BC) points (Table 6).
The presence of BC points in a molecule validates the creation of chemical bonds between the adsorbent and gas molecules and verifies that electron density is being transferred.The atoms in a molecule bind strongly and covalently if the values both ∇ 2 (ρ e ) and H e found are negative, whereas for ∇ 2 (ρ e ) > 0 and H e > 0, the interaction is weak and electrostatic 31,32 .On the other hand, the bonding nature is partially covalent for ∇ 2 (ρ e ) > 0 but H e < 0 .The bonding type is also determined by the.
− G e V e ratio.The bond is regarded as covalent if the ratio is less than 1 (i.e., − G e V e < 0.5 ), while the interaction is thought to be totally non-covalent (weak electrostatic) for − G e V e > 1 26,47 .If 0.5 < − G e V e < 1 , the bond can be identified as partially covalent.According to the study, the interaction of the O 3 molecule with TGC is strongly covalent resulting in a high adsorption energy.However, the dissociation of O 3 by PTGC is proved via QTAIM analysis.The O=P bond is shown to be partially covalent, whereas the O=O of O 2 gas is strongly covalent.The O 2 gas interacts with the 3 rd O atom bonded with P via weak electrostatic force.The S=O bond is shown to be partially covalent, whereas the interaction of SO 2 with both TGC and PTGC is non-covalent which results in comparatively low adsorption energies.

Conclusion
Quantum dots of TGC and PTGC have been designed and optimized successfully via DFT calculations.Both structures showed real frequencies revealing the possibility of their natural existence.The sensitivity of the capsules towards O 3 and SO 2 toxic gases has been studied.O 3 reveals a comparatively stronger attraction toward both TGC and PTGC than SO 2 gas.O 3 gas dissociates to O 2 via interacting with PTGC.A significant structural deformation and charge transfer suggest a preferable adsorbate-adsorbent interaction for sensing applications.The high adsorption energies of O 3 on the adsorbents result in a huge recovery time, which makes the regenerating of TGC and PTGC via the conventional irradiation process impractical.The TGC and PTGC may recover from O 3 gas, via interacting with various regenerating agents.The charge transfer and structural deformation result in a variation of HOMO and LUMO revealing a change in the energy gap of the absorbent, which can offer an alteration of conductivity allowing the absorbents to sense the presence of toxic gases.The optical property reveals a significant shift in UV-visible spectra in the visible region due to gas adsorption, which can allow determining the nature of adsorbed gas via color change.The adsorption of O 3 and SO 2 are exothermic and endothermic process respectively where all the resulting complexes are thermodynamically stable.The QTAIM analysis reveals the nature of adsorbent-adsorbate interaction to be strong or partially covalent.The electronic and optical properties suggest both TGC and PTGC to be potential candidates for numerous optoelectronic applications.The strong adsorption energies with variation in conductivity and optical response make both TGC and PTGC potential adsorbent materials for O 3 and SO 2 gas sensing.
shows the Mulliken charge distribution of the gas molecules, adsorbents and complexes.The central Oxygen (O) atom acts as the electron donor in the O 3 molecule, whereas in the SO 2 molecule (10) = complex − capsule − gas , 14:3467 | https://doi.org/10.1038/s41598-024-54110-zelectrons are shifted toward O atoms due to their high electronegativity.The Mulliken charges of all carbon (C) atoms are almost neutral in the TGC structure resulting in no net charge transfer between atoms.A significant charge transfer is observed in the TGC + O 3 complex with C atoms acting as electron donors.However, no notable change in color distribution in observed due to SO 2 adsorption on TGC, suggesting a nominal charge displacement.The PTGC QD showed charge asymmetry since the electronegativity of C is greater than that of P. Hence, P-C bonding electrons are displaced toward C resulting in partially negative C atoms and partially positive P

Figure 4 .
Figure 4. Mulliken charge transfer between adsorbent and gas molecules.

Figure 10 .
Figure10.UV visible spectra of the adsorbents and complexes.

Table 2 .
Adsorption energy and recovery time of the studied complexes.

Table 3 .
E H , E L , E g , and φ of the structures in the unit of eV.

Table 4 .
Global hardness, softness, chemical potential, and electrophilicity index of the structures.

Table 5 .
Change is enthalpy, Gibbs free energy, and entropy due to adsorption.

Table 6 .
Electron density ( ρ e ), ∇ 2 (ρ e ) , electron's kinetic ED ( G e ), potential ED ( V e ), total ED ( H e ), and − G e V e ratios in a.u.unit at BC point of intermolecular bonds.